﻿using BXH.Movie.Bll;
using BXH.Movie.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BXH.Movie.FrmAdmin
{
    public partial class FrmMovieTypeAdd : CCWin.CCSkinMain
    {
        private MovieInfoService movieInfoService = new MovieInfoService();
        public event EventHandler AddSuccess;
        public FrmMovieTypeAdd()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            var type = txtType.Text.Trim();
            MovieType movieType = new MovieType()
            {
                TypeName = type
            };
            movieInfoService.AddMovieType(movieType);
            AddSuccess?.Invoke(this,null);
            this.Close();
        }
    }
}
